home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Diamond Collection
/
The Diamond Collection (Software Vault)(Digital Impact).ISO
/
cdr45
/
mdidmo.zip
/
MDILOGO1.FRM
< prev
next >
Wrap
Text File
|
1994-04-12
|
7KB
|
245 lines
VERSION 2.00
Begin Form frmLogo
BorderStyle = 0 'None
ClientHeight = 4200
ClientLeft = 1155
ClientTop = 2205
ClientWidth = 8670
ClipControls = 0 'False
ControlBox = 0 'False
Height = 4605
Left = 1095
LinkTopic = "Form1"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 280
ScaleMode = 3 'Pixel
ScaleWidth = 578
Top = 1860
Width = 8790
Begin PictureBox Picture2
AutoSize = -1 'True
Height = 765
Left = 4980
Picture = MDILOGO1.FRX:0000
ScaleHeight = 735
ScaleWidth = 840
TabIndex = 3
Top = 300
Visible = 0 'False
Width = 870
End
Begin PictureBox Picture1
AutoSize = -1 'True
BorderStyle = 0 'None
Height = 810
Left = 3600
Picture = MDILOGO1.FRX:0422
ScaleHeight = 54
ScaleMode = 3 'Pixel
ScaleWidth = 56
TabIndex = 2
Top = 1230
Visible = 0 'False
Width = 840
End
Begin Label Label1
AutoSize = -1 'True
Caption = "This little skull is here because the Image control won't maintain the proper palette without it. :-("
Height = 705
Left = 4860
TabIndex = 4
Top = 1140
Visible = 0 'False
Width = 3090
WordWrap = -1 'True
End
Begin Image Image3
Height = 6840
Left = 4650
Picture = MDILOGO1.FRX:142C
Top = 90
Visible = 0 'False
Width = 6840
End
Begin Label Expl
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "Explanation"
FontBold = -1 'True
FontItalic = 0 'False
FontName = "MS Sans Serif"
FontSize = 12
FontStrikethru = 0 'False
FontUnderline = 0 'False
Height = 300
Left = 3450
TabIndex = 1
Top = 750
Width = 1425
End
Begin Label HiddenSwitch
Caption = "HiddenSwitch"
Height = 345
Left = 3390
TabIndex = 0
Top = 210
Visible = 0 'False
Width = 1545
End
Begin Image Image2
Height = 2880
Left = 150
Picture = MDILOGO1.FRX:4652
Top = 180
Visible = 0 'False
Width = 3075
End
Begin Image Image1
Height = 12480
Left = -300
Picture = MDILOGO1.FRX:8AB8
Top = 2970
Width = 15585
End
End
'---------------------------------------------------------------------------
' MDI Background Demo Program, Copyright (c) 1994 Karl E. Peterson
' Redistributed by permission. CompuServe: 72302,3707
' See MDILOGO.BAS for complete description
'---------------------------------------------------------------------------
'Default behavior
DefInt A-Z
Option Explicit
'Various options for background
Const bkNull = 0
Const bkStrWmf = 1
Const bkCenBmp = 2
Const bkStrBmp = 3
Const bkTilBmp = 4
'Highest numbered option
Const bkOptions = 4
Sub Form_Activate ()
'Force background to back, in case it somehow gets activated.
'This should really never occur, since it's disabled.
frmLogo.ZOrder 1
End Sub
Sub Form_Load ()
'Form needs to be disabled (to prevent it from activating),
'and doesn't need AutoRedraw for BitBlt.
Me.Enabled = False
Me.AutoRedraw = False
'BitBlt requires AutoRedraw be set to True.
Picture1.AutoRedraw = True
Picture2.AutoRedraw = True
'Image control needs to be auto-sized *after* startup
Image3.Stretch = True
'Set up the explanation label
Expl.Move 10, 10
'Trigger the initial background
HiddenSwitch = 1
End Sub
Sub Form_Paint ()
Select Case Val(HiddenSwitch)
Case bkTilBmp 'do a Tiled BitBlt
TiledBitBltPictToForm Picture1, Me
End Select
End Sub
Sub Form_Resize ()
'If a maximized form is restored, VB sends a ShowWindow to all
'children. We need to keep the hidden ones hidden!
Static LastState
If LastState = MAXIMIZED Then
mdiEnforceHidden
End If
LastState = WindowState
'Resize graphic background to fit new dimensions
Select Case Val(HiddenSwitch)
Case bkStrWmf 'Use next line for scaled WMF
Image1.Move 0, 0, Me.ScaleWidth, Me.ScaleHeight
Case bkCenBmp 'Use next line for fixed size BMP
Image2.Move (Me.ScaleWidth - Image2.Width) \ 2, (Me.ScaleHeight - Image2.Height) \ 2
Case bkStrBmp 'Use next lines for scaled BMP
StretchImageToForm Image3, Me
Case bkTilBmp
'Actually, it takes care of itself with the Paint event
End Select
End Sub
Sub HiddenSwitch_Change ()
'Determine which background to display
Dim NewImage%
NewImage = Val(HiddenSwitch)
'Roll back to beginning if we've exceeded the number available
If NewImage > bkOptions Then
HiddenSwitch = 0
Exit Sub 'prevent endless recursion
End If
'Hide label and force new background to right size
Expl.Visible = False
Form_Resize
'Reset properties appropriate to new background
Select Case NewImage
Case bkNull 'Currently Picture1 (Tiled BitBlt) switch to [None]
Cls
Expl = "No visible background"
Expl.ForeColor = RGB(0, 0, 0)
Case bkStrWmf 'Currently none switch to Image1 (NoIBM.WMF)
Me.BackColor = RGB(0, 0, 255)
Image1.ZOrder 0
Image1.Visible = True
Expl = "Strechable WMF"
Expl.ForeColor = RGB(255, 255, 255)
Case bkCenBmp 'Currently Image1 switch to Image2 (ECLPS4.BMP)
Image1.Visible = False
Me.BackColor = RGB(0, 0, 0)
Image2.ZOrder 0
Image2.Visible = True
Expl = "Centered BMP"
Expl.ForeColor = RGB(255, 255, 0)
Case bkStrBmp 'Currently Image2 switch to Image3 (BONES.BMP)
Image2.Visible = False
Me.BackColor = APPLICATION_WORKSPACE
Image3.ZOrder 0
Image3.Visible = True
Expl = "Strechable BMP"
Expl.ForeColor = RGB(0, 0, 0)
Case bkTilBmp 'Currently Image3 switch to Picture1 (FLOCK.BMP)
Image3.Visible = False
Expl = "Tiled BitBlt"
Expl.ForeColor = RGB(255, 255, 255)
Me.Refresh 'Needs to be called to invalidate entire rect?
End Select
'Force label to top and make it visible again
Expl.ZOrder 0
Expl.Visible = True
End Sub